//
//  TimerViewController.m
//  宝宝儿歌
//
//  Created by Clement_Gu on 16/4/19.
//  Copyright © 2016年 baobaoerge. All rights reserved.
//

#import "TimerViewController.h"

@interface TimerViewController ()<UIPickerViewDelegate,UIPickerViewDataSource>
@property(nonatomic,strong)NSArray *arrList;
@property (nonatomic,strong) UIPickerView *pikerView;
@end

@implementation TimerViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    //屏幕尺寸
    CGFloat width = [UIScreen mainScreen].bounds.size.width;
    CGFloat height = [UIScreen mainScreen].bounds.size.height;
    //数据
    self.arrList = @[@"10分钟",@"20分钟",@"30分钟",@"40分钟",@"50分钟",@"60分钟"];
    //创建界面
    [self buildPickerView:CGRectMake(width*0.2, height*0.3, width*0.6, 200)];
}

-(void)buildPickerView:(CGRect)frame
{
    UIPickerView *pickerView = [[UIPickerView alloc]initWithFrame:frame];
    self.pikerView = pickerView;
    self.pikerView.delegate = self;
    self.pikerView.dataSource = self;
    [self.view addSubview:pickerView];
    
}

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{

    return 1;
}

// returns the # of rows in each component..
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
    return 6;
}

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    
}

- (nullable NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
    return self.arrList[row];


}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
